package com.authine.cloudpivot.ext.dto.kingDee.request;

import com.authine.cloudpivot.ext.constants.PlatformConst;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

/**
 *
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Builder
@Schema(description = "K3-收货")
public class KingDeeOrderGoodsReceived  {

    /**
     * 客户ID
     */
//    private String customerId;
    /**
     * 客户当前组织名称
     */
    @Schema(description = "客户当前组织名称")
    private String customerName;
    /**
     * 客户父组织名称
     */
    @Schema(description = "客户父组织名称")
    private String parentCustomerName;
    /**
     * 客户订单号
     */
    @Schema(description = "客户订单号")
    private String customerOrderId;

    /**
     * 是否为虚拟供应商
     */
    @Schema(description = "是否为虚拟供应商")
    private Boolean virtual;
    /**
     * 供应商ID
     */
    @Schema(description = "供应商ID")
    private String vendorId;
    /**
     * 供应商订单ID
     */
    @Schema(description = "供应商订单ID")
    private String vendorOrderId;
    /**
     * 供应商名称
     */
    @Schema(description = "供应商名称")
    private String orgName;

    /**
     * 订单商品ID
     */
    @Schema(description = "订单商品ID")
    private String id;

    /**
     * 商品未税金额
     */
    @Schema(description = "商品未税金额")
    private BigDecimal preAmount;
    /**
     * 商品含税总计
     */
    @Schema(description = "商品含税总计")
    private BigDecimal Amount;
    /**
     * 转采金额
     */
    @Schema(description = "转采金额")
    private BigDecimal purchaseCostAmount;
    /**
     * 账套名
     */
    @Schema(description = "账套名")
    private String accountName;

    public String getAccountName() {
        return StringUtils.isBlank(accountName)?accountName: PlatformConst.PLATFORM_ORGANIZATIONS.get("2").equals(accountName)?"2":"1";
    }
}
